<?php
	namespace Mall\Model;
	use Common\Model\BaseModel;
	use Util\ModelUtils;
	class UserVoucherModel extends BaseModel{

		protected  $_auto =[
			['create_time','time',1,'function'],
			['status',0,1]
		];

		protected $_scope = [
			'valid'=>['where'=>['delete'=>0,'status'=>0]],
		];

		public function useVoucher($uid,$user_voucher_id)
		{
			$resp = D('UserVoucher')->where(['id'=>$user_voucher_id])->setField('status',2);
		}
	}